<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let years = +prompt('请输入年份')
        let month = +prompt('请输入月份')
        switch (month) {
            case 1:
                console.log('这个月31天');
                break
            case 2:
                if (years % 400 === 0 || years % 4 === 0 && years % 100 !== 0) {
                    console.log('这个月28天');
                } else {
                    console.log('这个月29天');
                }
                break
            case 3:
                console.log('这个月31天');
                break
            case 4:
                console.log('这个月30天');
                break
            case 5:
                console.log('这个月31天');
                break
            case 6:
                console.log('这个月30天');
                break
            case 7:
                console.log('这个月31天');
                break
            case 8:
                console.log('这个月31天');
                break
            case 9:
                console.log('这个月30天');
                break
            case 10:
                console.log('这个月31天');
                break
            case 11:
                console.log('这个月30天');
                break
            case 12:
                console.log('这个月31天');
                break
        }

    </script>
</body>

</html>